<!-- 我的课程 -->
<template>
	<z-paging ref="paging" v-model="dataList" @query="queryList" v-if="isshow">
		<Item :dataList="dataList" @goDetail="goDetail" :source="'course'" />
	</z-paging>
</template>

<script>
	import {
		myCourse
	} from '@/apis/apis.js'
	import Item from '@/components/c_item'
	export default {
		components: {
			Item
		},
		data() {
			return {
				dataList: [],
				isshow:false
			}
		},
		onShow() {
			this.isshow = true
		},
		onHide() {
			this.isshow = false
		},
		methods: {
			queryList(pageNum, pageSize) {
				myCourse({
					pageNum: pageNum,
					pageSize: pageSize
				}).then(res => {
					this.dataList = res.data
					this.$refs.paging.complete(res.data);
				})
			},
			goDetail(e) {
				console.log(e)	
				uni.navigateTo({
					url: `./detail?id=${e.courseId}&total=${e.resourceNum}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>
